import request from '@/utils/request.js'

const userApi = {
    selectAll() {
        return request.get('/user/selectAll')
    },
    list(userQuery) {
        return request.get('/user/list', {params: userQuery})
    },
    deleteById(id) {
        return request.delete(`/user/deleteById/${id}`)
    },
    deleteAll(ids) {
        return request.delete(`/user/deleteAll/${ids}`)
    },
    add(user) {
        return request.post(`/user/add`, user)
    },
    selectById(id) {
        return request.get(`/user/selectById/${id}`)
    },
    update(user) {
        return request.put(`/user/update`, user)
    },
    login(user) {
        return request.post(`/user/login`, user)
    },
    userInfo() {
        return request.get(`/user/userInfo`)
    },
    updateStatus(id, status) {
        return request.put(`/user/updateStatus/${id}/${status}`)
    },
    resetPassword(userPassword) {
        return request.put(`/user/resetPassword`, userPassword)
    },
    forgotPassword(userPassword) {
        return request.put(`/user/forgotPassword`, userPassword)
    }
}

export default userApi